home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: undergrad.math.uwaterloo.ca!crpalmer
- From: crpalmer@solo.uwaterloo.ca (Chris Palmer)
- Subject: #define "creating" strings ?
- Sender: news@undergrad.math.uwaterloo.ca (news spool owner)
- Message-ID: <Do9tsI.H2t@undergrad.math.uwaterloo.ca>
- Date: Thu, 14 Mar 1996 18:53:06 GMT
- Nntp-Posting-Host: solo.uwaterloo.ca
- Organization: University of Waterloo
-
- I have a problem that I would like to solve using a "feature" of the C
- preprocessor that until now I've never seen or heard of. A book that we have
- here gives the example:
-
- #define MAKESTRING(x) "x"
-
- which does in fact produce strings that have the value of x substituted.
- [eg: MAKESTRING(foo) gets processed into "foo"].
-
- I've verified this on a DEC Alpha (cc) and the GNU C compiler..
-
- Is this in fact a supported behaviour that should be portable to most
- C compilers?
-
- Cheers,
- Chris.
- --
- Mail: crpalmer@undergrad.uwaterloo.ca
- Homepage: http://www.undergrad.math.uwaterloo.ca/~crpalmer/
-